classdef ElectrodeInfo
    %ELECTRODEINFO
    
    properties
        OriginalChannelNumber = 0;
        RejectInPreprocessing = false;
        PreprocessedChannelNumber = 0;
        Label = '';
        Region = '';
        Subregion = '';
        LocationXYZ = [1 2 0];
        SelectedManually = false;
    end
    
    methods(Static)
        
        function [electrodes] = CreateElectrodeInfo( eeglabChanLocs )
            for i = 1:length(eeglabChanLocs)
                electrodes(i) = ElectrodeInfo;
                electrodes(i).OriginalChannelNumber = i;
                electrodes(i).Label = eeglabChanLocs(i).labels;
                % Unknown at import..   electrodes(i).LocationXYZ =
            end
        end
        
        function [electrode, idx] = FindByLabel(electrodes, label)
            x = {electrodes(:).Label};
            idx = strcmp(label, x);
            electrode = electrodes(idx);
        end
        
        function [region] = RegionByLabel(electrodes, label)
            x = {electrodes(:).Label};
            idx = strcmp(label, x);
            region = electrodes(idx).Region;
        end
        
        function [electrodes, idx] = FindBySubregion(electrodes, label)
            x = {electrodes(:).Subregion};
            idx = strcmp(label, x);
            electrodes = electrodes(idx);
        end
        
        function [electrodes, idx] = FindByRegion(electrodes, label)
            x = {electrodes(:).Region};
            idx = strcmp(label, x);
            electrodes = electrodes(idx);
        end
        
        
    end   
    
end

